// プロパティ画面
Ti.include( Ti.Filesystem.resourcesDirectory + '/win_common.js' );		// 画面共通設定
win.title = L('win_title_platform_prop');

var data = [];

// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform-module
var props = [
['Ti.Platform.*','header'],
['BATTERY_STATE_CHARGING',Ti.Platform.BATTERY_STATE_CHARGING],
['BATTERY_STATE_FULL',Ti.Platform.BATTERY_STATE_FULL],
['BATTERY_STATE_UNKNOWN',Ti.Platform.BATTERY_STATE_UNKNOWN],
['BATTERY_STATE_UNPLUGGED',Ti.Platform.BATTERY_STATE_UNPLUGGED],
['address',Ti.Platform.address],
['architecture',Ti.Platform.architecture],
['availableMemory',Ti.Platform.availableMemory],
['batteryLevel',Ti.Platform.batteryLevel],
['batteryMonitoring',Ti.Platform.batteryMonitoring],
['batteryState',Ti.Platform.batteryState],
['displayCaps',Ti.Platform.displayCaps],
['id',Ti.Platform.id],
['locale',Ti.Platform.locale],
['macaddress',Ti.Platform.macaddress],
['model',Ti.Platform.model],
['name',Ti.Platform.name],
['netmask',Ti.Platform.netmask],
['osname',Ti.Platform.osname],
['ostype',Ti.Platform.ostype],
['processorCount',Ti.Platform.processorCount],
['username',Ti.Platform.username],
['version',Ti.Platform.version]
];

for (var i=0; i < props.length; i++) {
	var row = Ti.UI.createTableViewRow({hasChild:false,height:'auto'});
	var row_view = Ti.UI.createView({
		height:'auto',
		layout:'vertical',
		left:5,
		top:5,
		bottom:5,
		right:5
	});

	var prop = Ti.UI.createLabel({
		text : props[i][0],
		font:{fontSize:14, fontWeight:'bold'},
		width:'100%',
		height:'auto',
	});
	row_view.add(prop);
	if (props[i][1] == 'header'){
		prop.color = '#fff';
		row.backgroundColor = '#333';
	}else{
		var val = Ti.UI.createLabel({
			text : "[" + props[i][1] + "]",
			font:{fontSize:13},
			textAlign : 'right',
			width:'100%',
			height:'auto',
		});
		row_view.add(val);
	}
	row.add(row_view);
	data.push(row);
};



// テーブルを作る
var tv = Ti.UI.createTableView({
	data : data
});

win.add(tv);
